package com.sci.web.dao;

import com.jfinal.plugin.activerecord.Page;
import com.sci.web.model.genmodel.EmailRecord;

public class EmailRecordDao extends EmailRecord {
	
	public static final EmailRecordDao me = new EmailRecordDao();
	
	
	/**  
	* @Title: insertEmailRecord  
	* @Description: 新增邮件记录
	* @param emailRecord
	* @return      
	* @returnType int      
	* @author LiuFei
	* @date 下午1:34:18
	* @throws  
	*/
	public int insertEmailRecord(EmailRecord emailRecord){
		boolean save = emailRecord.save();
		return save==true?1:0;
	}
	
	public int updateEmailRecord(EmailRecord emailRecord){
		boolean save = emailRecord.save();
		return save==true?1:0;
	}
	
	
	
	
	public Page<EmailRecord> getEmailRecordByPageInate(int pageNumber , int pageSize , String search){
		String selectStr = " select * ";
		String whereStr = " form "+EmailRecord.tableName+ " where 1=1 order by create_time desc ";
		return dao.paginate(pageNumber, pageSize,  selectStr ,  whereStr);
	}

}
